<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        #box {
            width: 100px;
            border: 1px solid gray;
            display: none;
            position: absolute;
        }
        li{
            width: 100%;
            list-style: none;
            height: 30px;
            line-height: 30px;
            text-indent: 5px;
            font-size: 14px;
            cursor: pointer;
        }
        li:hover{
            background: #f8f8f8;
        }
    </style>
</head>
<body>
<div id="box">
    <ul>
        <li>复制</li>
        <li>粘贴</li>
        <li>工具</li>
        <li>帮助</li>
    </ul>
</div>
<a href="8-25-work-3.html">拖拽</a>
</body>
<script>
    var box = document.getElementById("box");
    document.oncontextmenu = function(e) {
        var Event = e || event;
        box.style.display = "block";
        box.style.left = Event.clientX + "px";
        box.style.top = Event.clientY + "px";
        return false;
    }
    document.onclick = function() {
        box.style.display = "none";
    }
</script>
</html>